﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace XNAGame_Lab1
{
    public class MyText2D : MyObject
    {
        string _Text;

        public string Text
        {
            get { return _Text; }
            set { _Text = value; }
        }
        SpriteFont _SpiteFont;

        public SpriteFont SpiteFont
        {
            get { return _SpiteFont; }
            set { _SpiteFont = value; }
        }
        public MyText2D(ContentManager Content,  string text,SpriteFont font,Vector2 topleft)
        {
          //  Font1 = Content.Load<SpriteFont>("font");
            this.Position = topleft;
            _SpiteFont = font;
            this.Text = text;
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            //            for(int i =0;i<nTextures ; i++)
            spriteBatch.Begin();
            spriteBatch.DrawString(_SpiteFont, Text, Position, Color.Black);
            spriteBatch.End();
        }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
    }
}
